function visualiseKmeans(mix, data, dims, colour, level)


if nargin < 5
    level = 1;
end

if (nargin < 3) || (length(dims) < 2)
    dims = [1 2];
end

if ~isfield(mix, 'colours')
    mix.colours = rand(mix.ncentres, 3);
end


if(numel(data.Y) ~= 0)
    if ~isfield(data, 'C')
        if isfield(mix, 'C')
            data = createUncertainData(data.Y, mix.C, 'full');
        end
    end
    post = kmeanspostBayes(mix, data);
    [ingored L] = max(post, [], 2);
end


for i = 1:mix.ncentres
    cluster_points = data.Y(L == i, :);

    if(numel(cluster_points) ~= 0)
        plot(cluster_points(:, dims(1)), cluster_points(:, dims(2)), '.', 'Color', mix.colours(i, :), 'MarkerSize', 5);
    end
    hold on
    plot(mix.centres(i, dims(1)), mix.centres(i, dims(2)), '+', 'Color', mix.colours(i, :), 'MarkerSize', 20);

    if (nargin < 4) || (length(colour) < 3)
        cluster_colour = mix.colours(i, :);
    else
        cluster_colour = colour;
    end

    elipsnorm(mix.centres(i, dims), mix.covars(dims, dims, i), level, cluster_colour);
end
